<!-- ueditor所需引入 -->
@layout("/layout/ueditor.html"){}
<div class="tabbable">
	<ul class="nav nav-tabs" id="myTab">
		<li class="active"><a data-toggle="tab" href="#home"> <i
				class="green ace-icon fa fa-list-alt bigger-120"></i> 产品列表
		</a></li>
		@if(auth.hasPermission("gw:product:add")){
		<li class=""><a data-toggle="tab" href="#profile">
		<i class="green ace-icon fa fa-plus bigger-120"></i> 产品添加
		</a></li>
		@}
	</ul>

	<div class="tab-content">
		<div id="home" class="tab-pane active clearfix">
			<form action="${ctxPath}/product/list" method="post" id="search-form" target="list-page" class="clearfix">
				
				<div class="pull-left width-30">
					<label>描述：</label>
					<input type="text" class="width-80" name="description"/>
				</div>
				<div class="pull-left"><span class="btn btn-info btn-sm " id="search-btn">查 询</span></div>
			</form>
			<hr/>
			<div id="list-page"></div>
			<script type="text/javascript">
				$("#search-form").getPageList({'submitBtnId':'search-btn'})
			</script>
		</div>

		<div id="profile" class="tab-pane">
			<form action="${ctxPath!}/product/save" method="post" id="product-save-form">
		<div class="center padding-10">
			<label>标题：</label>
			<input type="text" class="width-50" name="title" datatype="*"  nullmsg="请输入title！"/>
		</div>
		<div class="center padding-10">
			<label>标签：</label>
			<input type="text" class="width-50" name="tag" datatype="*"  nullmsg="请输入tag！"/>
		</div>
		
		<div class="center padding-10">
			<label>类型：</label>
			<div class="width-50 inline text-left">
			@var typeList = selectUtil.getProductType();
			  	<#select name="type" class="width-50">
						@for(item in typeList){
							<option value="${item.id!}" ${decode(item.id,product.type!,"selected","")}>
							${item.name!}
							</option>
						@}
			   </#select>
			   </div>
		</div>
		<!-- <div class="center padding-10">
			<label>图片：</label>
			<input type="text" class="width-50" name="img" datatype="*"  nullmsg="请输入img！"/>
		</div> -->

		<div class="center padding-10">
					<textarea  style="width:93%;height:290px" name="remark" id="remark"></textarea>
		</div>
				
				<input type="hidden" name="remark" id="remark" />
				<input type="hidden" name="contentNoTag" id="contentNoTag" />
				<input type="hidden" name="summary" id="summary" />
				<div class="margin-t15">
					<span class="btn btn-info btn-block bigger-120" onclick="backValue()" id="product-save-btn">保 存</span>
				</div>
			</form>
		</div>
	</div>
	<script type="text/javascript">
		function backValue(){
			var content=UE.getEditor('remark').getContent();
	    	var contentNoTag=UE.getEditor('remark').getContentTxt();
	    	var summary=UE.getEditor('remark').getContentTxt().substr(0,155);
	    
	    	$("#content").val(content);
	    	$("#contentNoTag").val(contentNoTag);
	    	$("#summary").val(summary);
		}
		function reurl(){ 
			UE.getEditor('remark');
		} 
		setTimeout('reurl()',500); 	
	</script>
</div>
<#save isHide="yes" subBtnId="product-save-btn" formId="product-save-form" />
